﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ylcbtj.aspx.cs" Inherits="Catering.Catering_Page.Kufang.ylcbtj" %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<%@ Register src="../../UCPanle/DDLTool.ascx" tagname="DDLTool" tagprefix="uc1" %>
<%@ Register src="../../UCPanle/UCRightSearchTool.ascx" tagname="UCRightSearchTool" tagprefix="uc3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../../Style/head.css" />
    <link rel="stylesheet" type="text/css" href="../../Style/center.css" />
    <link href="../../Style/zhezhao.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="../../Style/xxk.js" type="text/javascript"></script>
    <script src="../../Style/zhezhao.js" type="text/javascript"></script>
    <style type="text/css">
    .xhfl_search{width:798px; border:1px solid #CDDEF8; background-color:#E5F1FD; height:auto; padding:6px 0px; margin:0px;}
    .Recipe_0206 h1 { background: url("../../Images/xzbz.gif") no-repeat 0px 0px;}
    #tvClass{padding:8px 8px; margin:0px 0px 0px auto;}
    .rawmatter{width:998px; border:1px solid #C2DEF6; background-color:#E5F1FD; border-top:none;}
    #CheckBoxList1 td{ height:26px;}
    .ylcb_title{height:30px; line-height:30px; text-align:center; font-size:14px; font-weight:bold;}
    .input_enablebg{background-color:#EAEAEA; background-image:none;}
    .tc_css { border: solid 10px #898989; background: #fff; width:396px; z-index: 1001; position: absolute; display: none; top: 30%; left: 50%; margin: -140px 0 0 -400px; margin-left: -25%; display: none; }
    .tc_css h2 { width: 100%; height: 30px; line-height: 30px; background: url(../../Images/div_h1_bg_02.gif) 0 0 repeat-x; font-size: 14px; font-weight: 400; }
    .tc_css b {margin-left: 10px; display: block; float: left; }
    .tc_css span { cursor: pointer; margin-right: 10px; display: block; float: right; }
    .tc_conter { width: 100%; padding:10px auto; }
    </style>
    <script type="text/javascript">
        function EditChargePerson() {
            $("#txt_Numbers").val("");
            var groupid = $("#DDLTool1_ddl_Area").val();
            var classid = $("#DDLTool1_ddl_class").val();
            var year = $("#DDLTool1_TextBox1").val();
            if (groupid <= 0) {
                alert("请选择作业区！");
                return;
            }
            if (classid <= 0) {
                alert("请选择班组！");
                return;
            }
            if (year <= 0) {
                alert("请选择年份！");
                return;
            }
            divshow('div1', 'div_add');
        }

        function AjaxSearch() {
            var bzid = $("#DDLTool1_ddl_class").val();
            var date = $("#DDLTool1_TextBox1").val();
            var month = $("#dl_Month").val();
            if (bzid == "") {
                alert("请选择班组！");
                return;
            }
            if (date == "") {
                alert("请输入年份！");
                return;
            }
            if (month == "") {
                alert("请输入月份！");
                return;
            }
            $.ajax({
                type: "Post",
                url: "ylcbtj.aspx/GetAjaxChargePerson",
                data: "{'StrClassID':'" + bzid + "','StrYear':'" + date + "','StrMonth':'" + month + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    if (data.d == "1") {
                        alert("请选择班组！");
                    }
                    else if (data.d == "2") {
                        alert("请选择年份！");
                    }
                    else if (data.d == "3") {
                        alert("请输入月份！");
                    }
                    else {
                        $("#txt_Numbers").val(data.d);
                    }
                }
            });
        }

        function AjaxCheck() {
            var zyqid = $("#DDLTool1_ddl_Area").val();
            var bzid = $("#DDLTool1_ddl_class").val();
            var date = $("#DDLTool1_TextBox1").val();
            var month = $("#dl_Month").val();
            var number = $("#txt_Numbers").val();
            if (zyqid == "") {
                alert("请选择作业区！");
                return;
            }
            if (bzid == "") {
                alert("请选择班组！");
                return;
            }
            if (date == "") {
                alert("请输入年份！");
                return;
            }
            if (month == "") {
                alert("请输入月份！");
                return;
            }
            $.ajax({
                type: "Post",
                url: "ylcbtj.aspx/ExistChargePerson",
                data: "{'StrClassID':'" + bzid + "','StrYear':'" + date + "','StrMonth':'" + month + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    if (data.d == "1") {
                        alert("请选择班组！");
                    }
                    else if (data.d == "2") {
                        alert("请选择年份！");
                    }
                    else if (data.d == "3") {
                        alert("请输入月份！");
                    }
                    else if (data.d == "NO") {
                        if (isNaN(number)) {
                            alert("签字收费人数输入错误！");
                        }
                        else {
                            AjaxAdd(zyqid,bzid, date, month, number);
                        }
                    }
                    else {
                        if (confirm("此签字收费人数已存在，是否覆盖？")) {
                            if (isNaN(number)) {
                                alert("签字收费人数输入错误！");
                            }
                            else {
                                AjaxAdd(zyqid,bzid, date, month, number);
                            }
                        }
                    }
                }
            });
        }

        function AjaxAdd(zyqid,bzid, date, month, number) {
            $.ajax({
                type: "Post",
                url: "ylcbtj.aspx/SetAjaxChargePerson",
                data: "{'StrGroupID':'" + zyqid + "','StrClassID':'" + bzid + "','StrYear':'" + date + "','StrMonth':'" + month + "','StrNumber':'" + number + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    if (data.d == "4") {
                        alert("添加成功！");
                        divhidel('div1', 'div_add');
                    }
                    else if (data.d == "5") {
                        alert("添加失败！");
                    }
                    else if (data.d == "6") {
                        alert("修改成功！");
                        divhidel('div1', 'div_add');
                    }
                    else if (data.d == "7") {
                        alert("修改失败！");
                    }
                }
            });
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" ScriptMode="Release" runat="server"></asp:ScriptManager>
    <div id="div_se_1" class="nav_2" style="display: block">
        <div class="nav_2_1"><img src="../../Images/nav2_bg1.gif" /></div>
        <ul>
            <li style="background: none; width:60px; "><a href="CostDataStatistics.aspx"><span id="span_peic_1" class="lvse_border">成本统计</span></a></li>
            <li style="background: none; width:60px; "><a href="XiaohaoTypeCrossChar.aspx"><span id="span_peic_2" class="feise_border">消耗统计</span></a></li>
            <li style="background: none; width:130px; "><a href="DataStates.aspx"><span id="span_peic_3" class="feise_border">出入库状态统计</span></a></li>
        </ul>
        <div class="nav_2_3"><img src="../../Images/nav2_bg2.gif" /></div>
    </div>
    <div class="xxk_button1">
        <ul>
            <li id="li2_1" class="li_out"><a href="CostDataStatistics.aspx" >成本数据统计</a></li>
            <li id="li2_2"class="li_out"><a href="CostDataPieChar.aspx" >成本比例图</a></li>
            <li id="li2_3" class="li_out"><a href="CostDataPersonAvgChar.aspx" >月人均成本明细</a></li>
            <li id="li2_4" class="li_over"><a href="ylcbtj.aspx" >原料成本统计</a></li>
            <li id="li2_5" class="li_out"><a href="cbydzs.aspx" >成本月度走势</a></li>
            <li id="li2_6" class="li_out"><a href="rjcbzs.aspx" >人均成本走势</a></li>
        </ul>
    </div>
    <asp:UpdatePanel runat="server" ID="UpdatePanel1">
        <ContentTemplate>
            <div class="Center_Content" id="div2_2" style="display: block">        
                <div class="div_0207 left_width500" style="height:34px; width:998px;">
                    <table align="left" width="100%" border="0" cellspacing="0" cellpadding="0" class="ckgl_table" style="height:34px">
                        <thead>
                            <tr>
                                <td><uc1:DDLTool ID="DDLTool1" ISAdminAll="false" runat="server" /></td>
                                <td width="100" align="right">
                                    <asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">开始统计</asp:LinkButton>
                                </td>
                                <td width="100" align="right">
                                    <a class="input_btn_a" href="javascript:EditChargePerson();">编辑收费人数</a>
                                </td>
                                <td width="10"></td>
                            </tr>
                        </thead>
                    </table>
                </div>
                <div class="rawmatter">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <thead>
                            <tr>
                                <td width="10">&nbsp;</td>
                                <td><asp:CheckBoxList ID="CheckBoxList1"  runat="server" AutoPostBack="True" 
                                ClientIDMode="Predictable" RepeatDirection="Horizontal" 
                                onselectedindexchanged="CheckBoxList1_SelectedIndexChanged" 
                                RepeatColumns="8" Width="980px">
                            </asp:CheckBoxList></td>
                            </tr>
                        </thead>
                    </table>
                </div>
                <div class="ylcb_title">
                    <asp:Label ID="ylcb_title" runat="server" Text=""></asp:Label>
                </div>
                <rsweb:ReportViewer Width="100%" ID="ReportViewer1" Height="436" Visible="false" runat="server" 
                    Font-Names="Verdana" Font-Size="8pt" InteractiveDeviceInfos="(集合)" BackColor="White" 
                    WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" style="padding-bottom:50px;">
                    <LocalReport ReportPath="Catering_Page\Kufang\Report\Cost_Data_ylcbtj.rdlc">
                    </LocalReport>
                </rsweb:ReportViewer>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <div class="footer"><strong>中海油能源发展配餐服务公司渤海自营油田作业公司&nbsp;&nbsp;版权所有@CopyRight 2012</strong><span>技术支持：北京天择嘉业科技有限公司</span></div>
    <!--遮罩层-->
    <div id="div1" class="bg"></div>
    <!--弹出层-->
    <div id="div_add" isadd="true" class="tc_css">
        <h2><b>编辑签字收费人数</b><span onclick="divhidel('div1','div_add')" title="关闭">[×]</span></h2>
        <div class="tc_conter">
            <table border="0" cellpadding="0" cellspacing="0" width="100%" style="border-bottom:1px dashed #ABC2E4;" align="center">
                <tr>
                    <td height="40" width="45" align="right">月份：</td>
                    <td width="55" >
                        <asp:DropDownList ID="dl_Month" CssClass="select_input_bg" Width="55" runat="server">
                            <asp:ListItem Value="1">1月</asp:ListItem>
                            <asp:ListItem Value="2">2月</asp:ListItem>
                            <asp:ListItem Value="3">3月</asp:ListItem>
                            <asp:ListItem Value="4">4月</asp:ListItem>
                            <asp:ListItem Value="5">5月</asp:ListItem>
                            <asp:ListItem Value="6">6月</asp:ListItem>
                            <asp:ListItem Value="7">7月</asp:ListItem>
                            <asp:ListItem Value="8">8月</asp:ListItem>
                            <asp:ListItem Value="9">9月</asp:ListItem>
                            <asp:ListItem Value="10">10月</asp:ListItem>
                            <asp:ListItem Value="11">11月</asp:ListItem>
                            <asp:ListItem Value="12">12月</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td>&nbsp;</td>
                    <td width="120" align="right">
                        <input type="button" name="sosuo" id="SearchBtn" onclick="AjaxSearch()" value="搜　索" class="input_btn_a" />
                    </td>
                    <td width="10">&nbsp;</td>
                </tr>
            </table>
            <table border="0" cellpadding="0" cellspacing="0" align="center">
                <tr>
                    <td style="border-bottom:1px dashed #ABC2E4" height="1" colspan="4"></td>
                </tr>
                <tr>
                    <td height="40" width="105" align="right">签字收费人数：</td>
                    <td width="100"><asp:TextBox ID="txt_Numbers" runat="server" CssClass="input_bg" style="width:80px;"></asp:TextBox></td>
                    <td width="100" align="center"><input type="button" id="btn_tijiao" value="保存" onclick="AjaxCheck()" class="input_btn_a" /></td>
                    <td width="100" align="center"><input type="button" id="btn_quxiao" value="取消" onclick="divhidel('div1','div_add')" class="input_btn_a" /></td>                    
                </tr>
                <tr>
                    <td height="10" colspan="4"></td>
                </tr>
            </table>
        </div>
    </div>
    </form>
</body>
</html>
